<template>
  <a-card :bordered="false" class="content">
    <div class="table_caozuo">
      <template v-for="(item,index) in btn">
        <a-button
          :key="index"
          @click="handler(index)"
          v-if="item.isShow"
          type="primary"
        >{{item.title}}</a-button>
      </template>
      <!-- <span>{{ '已选择 '+number+' 项' }}</span>
      <a-button type="link" @click="clearSelection">清空</a-button>-->
    </div>
    <a-table
      rowKey="categoryId"
      :columns="tableOption"
      :dataSource="loadData"
      :pagination="false"
      :loading="loading"
      :scroll="{ x:1720}"
    >
    <template slot-scope="text,record,index" slot="indexLabel">
        <span>{{index+(page.current - 1) * page.size + 1}}</span>
      </template>
      <el-image
        slot="img"
        slot-scope="categoryIcon"
        style="width: 50px; height: 50px"
        :src="categoryIcon"
        :preview-src-list="[categoryIcon]"
      ></el-image>
    </a-table>
    <template>
      <div style="width:100%;position:relative;height:60px">
        <a-pagination
          show-quick-jumper
          show-size-changer
          v-model="page.current"
          :page-size-options="['10', '20', '30', '40', '50']"
          :total="page.total"
          :page-size.sync="page.size"
          @showSizeChange="onShowSizeChange"
          @change="onShowSizeChange"
          :show-total="total => `共 ${total} 条`"
          style="margin:2% 0;position:absolute;right:1%"
        />
      </div>
    </template>
    <addCategory ref="addCategory" />
  </a-card>
</template>

<script src='./index.js'></script>

<style lang="less">
.content {
  & > .ant-card-body {
    padding: 0;
    padding-top: 8px;
  }
}
</style>